package com.whcoding.designpatterns.pattern.proxy.cglib;

/**
 * @program: spring-boot-learning
 * @description:
 * @author: whcoding
 * @create: 2022-09-21 10:41
 **/
public class CglibProxyTests {

	public static void main(String[] args) {
		// 创建目标对象
		TeacherDao target = new TeacherDao();
		// 获取到代理对象，并且将目标对象传递给代理对象
		TeacherDao instance = (TeacherDao) new DynamicProxyFactory(target).getProxyInstance();
		// 执行代理方法
		instance.teach();
	}
}
